﻿<%
dim conn,connstr,db
db="../data/#data.mdb" '数据库文件位置
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
end if

sub CloseConn()
	conn.close
	set conn=nothing
end sub
Sub Alert_GoURL (str,strURL)
	Response.Write "<script language=""JavaScript"">" & chr(13)
	Response.Write "<!--" & chr(13)
	Response.Write "//" & chr(13)
	Response.Write "alert (""" & str & """);" & chr(13)
	Response.Write "window.location.href=""" & strURL & """;" & chr(13)
	Response.Write "//-->" & chr(13)
	Response.Write "</script>" & chr(13)
	Response.End
End Sub
Sub AlertError (str)
	Response.Write "<script language=""JavaScript"">" & chr(13)
	Response.Write "<!--" & chr(13)
	Response.Write "//" & chr(13)
	Response.Write "alert (""" & str & """);" & chr(13)
	Response.Write "window.history.back();" & chr(13)
	Response.Write "//-->" & chr(13)
	Response.Write "</script>" & chr(13)
	Response.End
End Sub

%>
